package com.zl.basic.Utils;

import com.zl.basic.model.User;
import junit.framework.Assert;

import java.util.List;

/**
 * User: zl email:c3tc3tc3t@126.com Date: 14-1-11 Time: 下午3:26
 */
public class EntitiesHelper {
  private static User baseUser = new User(1, "admin1");

  public static void assertUser(User expected, User actual) {
    Assert.assertNotNull(actual);
    Assert.assertEquals(expected.getId(), actual.getId());
    Assert.assertEquals(expected.getUsername(), actual.getUsername());
  }

  public static void assertUsers(List<User> expected, List<User> actuals) {
    for (int i = 0; i < expected.size(); i++) {
      User eu = expected.get(i);
      User au = actuals.get(i);
      assertUser(eu, au);
    }
  }

  public static void assertUser(User actual) {
    assertUser(baseUser,actual);
  }
}
